package controllers

import (
	"cps/utils"
)

type UserController struct {
	BaseController
}

type User struct {
	Id    int    `json:"id"`
	Name  string `json:"name,omitempty"`
	Age   int    `json:"-"`
	IsDel bool   `json:"isDel"`
}

// @Title Get
// @Description get user by uid
// @Param	uid		path 	string	true		"The key for staticblock"
// @Success 200 {object} models.User
// @Failure 403 :uid is empty
// @router /:uid [get]
func (u *UserController) Get() {
	authToken := utils.JwtClaims{UserId: "absdfsdfsdlkfjsdlfc"}
	tokenStr, _ := utils.JwtGetToken(authToken)
	userId, _ := utils.JwtToUser(tokenStr)
	println(userId)
	id := utils.NewUid()
	data := User{Id: 1, Name: id, Age: 12, IsDel: false}
	u.ApiViewOk(data)
}
